// pages/apiui/apiui.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
  
  },
  authorize:function(){
    wx.authorize({
      scope: 'scope.userLocation',
      success:function(res){
        console.log(res)
      }
    })

  },
  bindgetuserinfo:function(e){
console.log(e)
  },
  startPull:function(){
wx.startPullDownRefresh({
  
})
  },
  stopPull:function(){
    console.log("onPullDownRefresh")
  },
    
  relauch:function(){
wx.reLaunch({
  url: '/pages/request/request',
})
  },
  redirect:function(){
wx.redirectTo({
  url: '/pages/request/request',
})
  },
  switchtab:function(){
wx.switchTab({
  url: '/pages/index/index',
})
  },
  onShareAppMessage:function(){
    return {
      title: '自定义转发标题',
      path: '/page/request/request'
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  //  console.log(options)
   //wx.setNavigationBarTitle({
  //   title: options.title
   //})
   wx.getUserInfo({
     success:function(e){
       console.log(e)
     }
   })
  },
  
  settitle:function(){
    wx.setNavigationBarTitle({
      title: '当前页面'
    })

  },
  showActionSheet:function(){
    wx.showActionSheet({
      itemList: ['A', 'B', 'C'],
   
      success: function (res) {
        console.log(res)
      }

    })
  },
  showtoast:function(){
  wx.showToast({
    title: 'title',
    icon:'loading',
    image:"/image/2.jpg",
    mask:true,
  })
  },
  test:function(){
console.log("test")
  },
  showloding:function(){
wx.showLoading({
  title: 'title',
})
setTimeout(function(){
  wx.hideLoading()
},2000)
  },
  showmodal:function(){
wx.showModal({
  title: 'title',
  content: 'content',
  showCancel:true,
  cancelText:'test',
  success:function(){
    console.log(res)
  }
})
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})